Lesson 5 - advanced exercise

For each scenario suggest what variables would be needed and what their data types would be. You do not need to write the code for them. Note that the intermediate and advanced exercises will start to use pygame

Scenario - Create a star field of 100 stars. Each star will have its own speed and position. The stars will travel from left to right and when they go off screen they will start at the far right with a new position and speed. (chosen randomly). To help you can use tuples (eg (x,y) is a tuple used to store co-ordinates. This makes the star field much cleaner)

Toggle answer

Scenario - Have a character which can move by using keys and have a baddie which is moving towards the character at all times. If they collide then the game is over. Overtime the baddie gets faster and each second the player gets 10 points.

Toggle answer